﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Redmine.Core.Locals;
using UnitOfWork.Validation;

namespace Redmine.Core.Entities
{
    /// <summary>
    /// 系统配置
    /// </summary>
    public class Setting
    {
        public int Id { get; set; }

        [MaxLength(2),
        Uniqueness("Settings", ErrorMessageResourceType = typeof(Lang), ErrorMessageResourceName = "ErrMsg_Exists"),
        Remote("CheckName", "Setting")]
        public string Name { get; set; }

        [Remote("CheckValue", "Setting", AdditionalFields = "Name")]
        public string Value { get; set; }

        public DateTime UpdateOn { get; set; }


        /// <summary>
        /// 日期显示格式
        /// </summary>
        public static List<string> DateFormats = new List<string>()
                                                     {
                                                         "%Y-%m-%d",
                                                         "%d/%m/%Y",
                                                         "%d.%m.%Y",
                                                         "%d-%m-%Y",
                                                         "%m/%d/%Y",
                                                         "%d %b %Y",
                                                         "%d %B %Y",
                                                         "%b %d, %Y",
                                                         "%B %d, %Y"
                                                     };

        /// <summary>
        /// 时间显示格式
        /// </summary>
        public static List<string> TimeFormats = new List<string>() {
        "%H:%M",
        "%I:%M %p"
        };



    }
}
